import MainView from '@/views/MainView.vue';
import LoginView from '@/views/user/LoginView.vue';
import HomeView from '@/views/home/HomeView.vue';
import goodsRoutes from './moudle/goods';
import warehouseRoutes from './moudle/warehouse';
import {House,} from '@element-plus/icons-vue';

export const routes =[
    {
        path:"/",
        name:"main",
        component:MainView,
        redirect:{
            path:"/home"
        },
        children:[
            {
                path:"/home",
                name:"home",
                title:"首页",
                icon:House,
                component:HomeView,
                isItem:true
            },
            //完成多个模块路由的解构
            ...goodsRoutes,
            ...warehouseRoutes
        ]
    },
    {
        path:"/user/login",
        name:"login",
        component:LoginView,
    },
    {
        path:"/404",
        name:"notfound",
        component:()=>import("@/views/error/NotFound.vue")
    },
    {
        //在新版路由中不允许写 /* 和*
        path:"/:pathMatch(.*)*",
        redirect:{
            path:"/404"
        },
    }
]

console.log(`output->routes`,routes)